<?php
class setLangAction extends ajaxAction
{
	public function execute($request) {
		parent::execute($request);
		
		$result = false;
		$error = '';
		
		$lang = $request->getParameter('lang');
		if ($lang) {
			$this->getUser()->setAttribute('lang',$lang);
			$result = true;			
		} else
			$error = '请选择切换语言的种类。';
			
		echo json_encode(array(
			'result' => $result,
			'error'	=> $error
		));
		
		return sfView::NONE;
	}
}